package com.sky.mapper.admin;

import com.github.pagehelper.Page;
import com.sky.dto.DishPageQueryDTO;
import com.sky.pojo.Dish;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {

    /**
     * 根据分类id查询菜品数量
     * @param categoryId
     * @return
     */
    @Select("select count(id) from dish where category_id = #{categoryId}")
    Integer countByCategoryId(Long categoryId);

    Page<DishVO> page(DishPageQueryDTO dto);


    void update(Dish dish);


    DishVO getById(Long dishId);

    void update1(Dish dish);

    Integer selectCountByIdsAndStatus(@Param("ids") List<Long> ids,@Param("status") Integer enable);

    void deleterdish(List<Long> ids);

    void DishActivation(Long id, Integer status);


    List<Dish> list(Dish dish);

    List<Dish> getBysetmealId(Long id);
}
